package com.honey.comment.grammer;

import org.java.plugin.Plugin;
import org.java.plugin.PluginLifecycleException;

import com.honey.comment.grammer.colon.ColonCommentGrammar;
import com.honey.core.NullPlugin;
import com.honey.core.utils.ObjectFactory;

public class ColumnCommentProcessorPlugin extends NullPlugin{

	/** 数据库comment扩充语法插入点 */
	public static final String EXTENSION_DATABASE_COMMENT_GRAMMAR = "DatabaseCommentGrammar";
	
	/**
	 * 数据库comment扩充语法插入点
	 * @return
	 * @throws PluginLifecycleException
	 */
	public DatabaseCommentGrammar getDatabaseCommentGrammar(){
		DatabaseCommentGrammar answer = new ColonCommentGrammar();
		try {
			com.honey.core.Extension<Plugin>  extension = ObjectFactory.getExtensionClass(this, EXTENSION_DATABASE_COMMENT_GRAMMAR);
			if( extension instanceof DatabaseCommentGrammar){
				answer = (DatabaseCommentGrammar)extension;
			}
		} catch (PluginLifecycleException e) {
			e.printStackTrace();
		}
		return answer;
	}
}
